#ifndef GLBACKGROUNDPROGRAM_H
#define GLBACKGROUNDPROGRAM_H

#include <QOpenGLShaderProgram>
#include <QOpenGLShader>
#include <QHash>
#include <QVector>
#include "AreaTest/ServerDefine.h"

class GLBackgroundProgram : public QOpenGLShaderProgram
{
public:
    GLBackgroundProgram(const QString &vertex, const QString &fragment, QObject *parent = nullptr);
    ~GLBackgroundProgram();
    virtual void setLocation();

    int getLocation(const QString &key);
    int getBackgroundVertexSize();
    const GLfloat *getBackgroundVertexData();

private:
    void setBackGround();

private:
    QOpenGLShader *vShader;
    QOpenGLShader *fShader;
    QHash<QString, int> locationHash;
    QVector<GLfloat> backgroundVertex;
};

#endif // GLBACKGROUNDPROGRAM_H
